/* 苹果官网配色系统 - CSS变量定义 */
:root {
  /* 苹果官网基础色彩系统 */
  --apple-white: #ffffff;
  --apple-gray-50: #f5f5f7;
  --apple-gray-100: #f2f2f7;
  --apple-gray-200: #e8e8ed;
  --apple-gray-300: #d2d2d7;
  --apple-gray-400: #a1a1a6;
  --apple-gray-500: #86868b;
  --apple-gray-600: #6d6d70;
  --apple-gray-700: #515154;
  --apple-gray-800: #424245;
  --apple-gray-900: #1d1d1f;
  --apple-black: #000000;
  
  /* 苹果蓝色系统 */
  --apple-blue: #007aff;
  --apple-blue-dark: #0056cc;
  --apple-blue-light: #4da6ff;
  --apple-blue-ultra-light: rgba(0, 122, 255, 0.1);
  
  /* 语义色彩系统 */
  --apple-green: #30d158;
  --apple-green-dark: #28cd41;
  --apple-red: #ff3b30;
  --apple-red-dark: #d70015;
  --apple-orange: #ff9500;
  --apple-orange-dark: #ff8c00;
  --apple-yellow: #ffcc00;
  --apple-yellow-dark: #ffb000;
  
  /* 交互状态颜色 */
  --apple-hover-bg: rgba(0, 0, 0, 0.04);
  --apple-active-bg: rgba(0, 0, 0, 0.08);
  --apple-focus-ring: rgba(0, 122, 255, 0.25);
  
  /* 阴影系统 */
  --apple-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --apple-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --apple-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --apple-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  
  /* 边框半径系统 */
  --apple-radius-sm: 6px;
  --apple-radius-md: 8px;
  --apple-radius-lg: 12px;
  --apple-radius-xl: 16px;
  --apple-radius-2xl: 20px;
  
  /* 设置页面专用变量 */
  --primary-color: var(--apple-blue);
  --primary-hover: var(--apple-blue-dark);
  --card-background: var(--apple-white);
  --border-color: var(--apple-gray-300);
  --text-primary: var(--apple-gray-900);
  --text-secondary: var(--apple-gray-600);
  --input-background: var(--apple-white);
  --secondary-background: var(--apple-gray-50);
  --hover-background: var(--apple-gray-100);
  
  /* 深色主题变量 */
  --dark-card-background: var(--apple-gray-800);
  --dark-border-color: var(--apple-gray-600);
  --dark-text-primary: var(--apple-gray-100);
  --dark-input-background: var(--apple-gray-700);
  --dark-secondary-background: var(--apple-gray-700);
  --dark-hover-background: var(--apple-gray-600);
  
  /* 过渡动画 */
  --apple-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --apple-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色模式变量 */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-white: #000000;
    --apple-gray-50: #1c1c1e;
    --apple-gray-100: #2c2c2e;
    --apple-gray-200: #3a3a3c;
    --apple-gray-300: #48484a;
    --apple-gray-400: #636366;
    --apple-gray-500: #8e8e93;
    --apple-gray-600: #aeaeb2;
    --apple-gray-700: #c7c7cc;
    --apple-gray-800: #d1d1d6;
    --apple-gray-900: #f2f2f7;
    --apple-black: #ffffff;
    
    --apple-blue: #0a84ff;
    --apple-blue-dark: #409cff;
    --apple-blue-light: #64a8ff;
    --apple-blue-ultra-light: rgba(10, 132, 255, 0.15);
    
    --apple-green: #32d74b;
    --apple-red: #ff453a;
    --apple-orange: #ff9f0a;
    --apple-yellow: #ffd60a;
    
    --apple-hover-bg: rgba(255, 255, 255, 0.08);
    --apple-active-bg: rgba(255, 255, 255, 0.16);
  }
}

/* 手动暗色模式切换支持 */
[data-theme="dark"] {
  --apple-white: #000000;
  --apple-gray-50: #1c1c1e;
  --apple-gray-100: #2c2c2e;
  --apple-gray-200: #3a3a3c;
  --apple-gray-300: #48484a;
  --apple-gray-400: #636366;
  --apple-gray-500: #8e8e93;
  --apple-gray-600: #aeaeb2;
  --apple-gray-700: #c7c7cc;
  --apple-gray-800: #d1d1d6;
  --apple-gray-900: #f2f2f7;
  --apple-black: #ffffff;
  
  --apple-blue: #0a84ff;
  --apple-blue-dark: #409cff;
  --apple-blue-light: #64a8ff;
  --apple-blue-ultra-light: rgba(10, 132, 255, 0.15);
  
  --apple-green: #32d74b;
  --apple-red: #ff453a;
  --apple-orange: #ff9f0a;
  --apple-yellow: #ffd60a;
  
  --apple-hover-bg: rgba(255, 255, 255, 0.08);
  --apple-active-bg: rgba(255, 255, 255, 0.16);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', Roboto, sans-serif;
    background: var(--apple-white);
    color: var(--apple-gray-900);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: var(--apple-transition);
}

/* 导航栏 - 苹果官网风格 */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--apple-gray-200);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 20px;
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--apple-gray-900);
    position: relative;
}

.nav-menu {
    display: flex;
    gap: 50px;
}

.nav-link {
    text-decoration: none;
    color: var(--apple-gray-600);
    font-size: 15px;
    font-weight: 500;
    transition: var(--apple-transition);
    cursor: pointer;
    position: relative;
    padding: 10px 18px;
    border-radius: var(--apple-radius-md);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
    border-color: rgba(0, 122, 255, 0.3);
}

.nav-link.active {
    color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.2);
}

/* 主内容区域 */
.main-content {
    margin-top: 70px;
    padding: 40px 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 优化数据大屏样式 */
.dashboard-header {
    margin-bottom: 50px;
}

/* 选项卡 - 苹果风格 */
.dashboard-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 2px;
    margin-bottom: 40px;
    background: var(--apple-gray-50);
    padding: 4px;
    border-radius: var(--apple-radius-lg);
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
}

.tab-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-gray-500);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn:hover {
    color: var(--apple-gray-600);
    background: var(--apple-blue-ultra-light);
}

.tab-btn.active {
    color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .dashboard-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .dashboard-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        white-space: nowrap;
        min-width: auto;
        flex-shrink: 0;
    }
}
.dashboard-content {
    display: none;
}

.dashboard-content.active {
    display: block;
    animation: contentFadeIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 优化指标卡片 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
    margin-bottom: 50px;
}

.metric-card {
    background: #ffffff;
    border-radius: var(--apple-radius-xl);
    padding: 35px 25px;
    text-align: center;
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
    border: 1px solid var(--apple-gray-200);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--apple-blue);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.metric-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--apple-shadow-lg);
    border-color: var(--apple-gray-300);
}

.metric-card:hover::after {
    opacity: 1;
}

.metric-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--apple-gray-600);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

.metric-value {
    font-size: 48px;
    font-weight: 900;
    color: var(--apple-blue);
    margin-bottom: 15px;
    position: relative;
}

/* 容器样式 - 苹果风格 */
.chart-container,
.rankings-container,
.data-table {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 30px;
    border: 1px solid var(--apple-gray-200);
    margin-bottom: 25px;
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
}

.chart-container {
    height: 450px;
    position: relative;
}

/* 优化表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
    background: var(--apple-gray-50);
    color: var(--apple-gray-700);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

td {
    color: var(--apple-gray-600);
    border-bottom: 1px solid var(--apple-gray-200);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

tr:hover td {
    background: var(--apple-blue-ultra-light);
}

/* 优化AI分析和设置页面 */
.ai-header, .settings-header {
    text-align: center;
    margin-bottom: 50px;
}

.ai-header h1, .settings-header h1 {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.ai-content, .settings-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 优化表单样式 */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.save-btn:active {
    transform: translateY(-1px);
}

/* 排行榜选项卡样式 */
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.ranking-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.ranking-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ranking-tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 排序控制样式 */
.ranking-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sort-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.sort-btn:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

/* 排行榜标题和图例 */
.ranking-header {
    margin-bottom: 20px;
}

.ranking-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}

.ranking-legend {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.legend-item {
    flex: 1;
    text-align: center;
}

.legend-item:first-child {
    flex: 0 0 60px;
    text-align: left;
}

.legend-item:last-child {
    flex: 0 0 100px;
    text-align: right;
}

/* 更新排行榜项目样式 */
.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rank-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.rank-item .rank {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.rank-item .name {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    flex: 1;
    margin-left: 20px;
}

.rank-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    min-width: 80px;
    text-align: right;
}

.rank-item .score {
        font-size: 20px;
        font-weight: 700;
        color: #10b981;
    }
    
    /* 响应式设计 */
    .ranking-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .ranking-tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ranking-controls {
        justify-content: center;
    }
    
    .rank-item {
        padding: 14px 16px;
    }
    
    .rank-item .rank {
        font-size: 18px;
        min-width: 35px;
    }
    
    .rank-item .name {
        font-size: 15px;
        margin-left: 15px;
    }
    
    .rank-item .value {
        font-size: 16px;
        min-width: 70px;
    }

/* 前三名特殊样式 */
.rank-item:nth-child(1) .rank {
    color: #fbbf24;
}

.rank-item:nth-child(2) .rank {
    color: #9ca3af;
}

.rank-item:nth-child(3) .rank {
    color: #f59e0b;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .nav-container {
        height: 70px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 8px 14px;
    }
    
    .main-content {
        margin-top: 70px;
        padding: 30px 15px;
    }
    
    .dashboard-tabs {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metric-card {
        padding: 30px 20px;
    }
    
    .metric-value {
        font-size: 32px;
    }
    
    .ai-header h1, .settings-header h1 {
        font-size: 32px;
    }
    
    .chart-container,
    .rankings-container,
    .data-table,
    .ai-content,
    .settings-content {
        padding: 25px;
    }
}

/* 添加加载动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 添加滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 在dashboard-header样式后添加筛选组件样式 */



/* 响应式优化 - 移动端 */
@media (max-width: 768px) {
    .dashboard-filters {
        top: 70px; /* 移动端导航栏高度 */
        padding: 15px 16px;
        margin-bottom: 20px;
    }
    
    .dashboard-filters.sticky {
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    }
    
    .filters-container {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }
    
    .filter-apply-btn,
    .filter-reset-btn {
        flex: 1;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .dashboard-filters {
        padding: 12px 15px;
        border-radius: 12px;
    }
    
    .filter-select,
    .filter-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .filter-apply-btn,
    .filter-reset-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes filterSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-filters {
    animation: filterSlideIn 0.6s ease-out;
}

/* 加载状态 */
.filter-loading {
    pointer-events: none;
    opacity: 0.7;
}

.filter-loading .filter-apply-btn {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
}

.filter-loading .filter-apply-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateX(0);
}

.message.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.message.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* 指标分类标题 */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--apple-gray-900);
    margin-bottom: 25px;
    padding: 15px 0;
    position: relative;
    text-align: left;
    border-bottom: 2px solid var(--apple-gray-200);
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background: var(--apple-blue);
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

/* 指标卡片 - 科技感设计 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.metrics-section {
    margin-bottom: 60px;
    position: relative;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .section-title {
        font-size: 20px;
    }
    
    .metrics-section {
        margin-bottom: 30px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
.dashboard-content {
    display: none;
}

.dashboard-content.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 重复的metric-card定义已删除 */

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.metric-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 36px;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* 优化容器样式 */
.chart-container,
.rankings-container,
.data-table {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

.chart-container {
    height: 450px;
    position: relative;
}

/* 优化表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
    font-weight: 700;
    color: var(--apple-gray-700);
    background: var(--apple-gray-50);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

td {
    color: var(--apple-gray-600);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

tr:hover td {
    background-color: var(--apple-blue-ultra-light);
}

/* 优化AI分析和设置页面 */
.ai-header, .settings-header {
    text-align: center;
    margin-bottom: 50px;
}

.ai-header h1, .settings-header h1 {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.ai-content, .settings-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 优化表单样式 */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.save-btn:active {
    transform: translateY(-1px);
}

/* 添加排行榜样式 */
.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.rank-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    transform: translateX(5px);
}

.rank-item .rank {
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
    min-width: 40px;
}

.rank-item .name {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    flex: 1;
    margin-left: 20px;
}

.rank-item .score {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .nav-container {
        height: 70px;
    }
    
    .nav-logo h2 {
        font-size: 20px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .main-content {
        margin-top: 70px;
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .dashboard-tabs {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metric-card {
        padding: 25px 20px;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .ai-header h1, .settings-header h1 {
        font-size: 32px;
    }
    
    .chart-container,
    .rankings-container,
    .data-table,
    .ai-content,
    .settings-content {
        padding: 25px;
    }
}

/* 添加加载动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 添加滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 在dashboard-header样式后添加筛选组件样式 */

/* 筛选条件 - 苹果风格 */
.dashboard-filters {
    background: var(--apple-gray-50);
    border-radius: var(--apple-radius-lg);
    padding: 20px 25px;
    margin-bottom: 30px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
    position: sticky;
    top: 70px; /* 与导航栏高度保持一致 */
    z-index: 999; /* 确保在其他内容之上，但低于导航栏 */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* 添加过渡效果 */
    transition: all 0.3s ease;
}

/* 当筛选框处于sticky状态时的样式优化 */
.dashboard-filters.sticky {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--apple-gray-300);
}

/* 暗色模式下的sticky状态 */
[data-theme="dark"] .dashboard-filters.sticky {
    background: rgba(28, 28, 30, 0.95);
    border-color: var(--apple-gray-400);
}

.filters-container {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    flex: 1;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--apple-gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    padding: 10px 14px;
    border: 1px solid var(--apple-gray-300);
    border-radius: var(--apple-radius-md);
    background: var(--apple-white);
    color: var(--apple-gray-900);
    font-size: 14px;
    transition: var(--apple-transition);
    height: 40px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--apple-blue);
    background: var(--apple-white);
    box-shadow: 0 0 0 2px var(--apple-focus-ring);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-left: auto;
}

.filter-apply-btn {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-blue-dark) 100%);
    color: var(--apple-white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
    height: 40px;
    min-width: 80px;
}

.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.filter-reset-btn {
    background: var(--apple-gray-100);
    color: var(--apple-gray-600);
    border: 1px solid var(--apple-gray-300);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 40px;
    min-width: 80px;
}

.filter-reset-btn:hover {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
    transform: translateY(-2px);
}

.filter-download-btn {
    background: linear-gradient(135deg, var(--apple-green) 0%, var(--apple-green-dark) 100%);
    color: var(--apple-white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(48, 209, 88, 0.3);
    height: 40px;
    min-width: 100px;
}

.filter-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(48, 209, 88, 0.4);
}
}

.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.filter-reset-btn {
    background: var(--apple-gray-100);
    color: var(--apple-gray-600);
    border: 1px solid var(--apple-gray-300);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 40px;
    min-width: 80px;
}

.filter-reset-btn:hover {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
    transform: translateY(-2px);
}

.filter-download-btn {
    background: linear-gradient(135deg, var(--apple-green) 0%, var(--apple-green-dark) 100%);
    color: var(--apple-white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(48, 209, 88, 0.3);
    height: 40px;
    min-width: 100px;
}

.filter-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(48, 209, 88, 0.4);
}

.filter-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.filter-reset-btn {
    background: transparent;
    color: var(--apple-gray-500);
    border: 1px solid var(--apple-gray-300);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 40px;
    min-width: 70px;
}

.filter-reset-btn:hover {
    color: var(--apple-gray-600);
    border-color: var(--apple-gray-400);
    background: var(--apple-hover-bg);
}



@media (max-width: 480px) {
    .dashboard-filters {
        padding: 20px 15px;
    }
    
    .filter-select,
    .filter-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .filter-apply-btn,
    .filter-reset-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes filterSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-filters {
    animation: filterSlideIn 0.6s ease-out;
}

/* 加载状态 */
.filter-loading {
    pointer-events: none;
    opacity: 0.7;
}

.filter-loading .filter-apply-btn {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
}

.filter-loading .filter-apply-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateX(0);
}

.message.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.message.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}




/* 暗色模式切换按钮 */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--apple-gray-300);
    border-radius: var(--apple-radius-md);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--apple-transition);
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--apple-hover-bg);
    border-color: var(--apple-gray-400);
}

.theme-icon {
    font-size: 16px;
    display: block;
}

/* 暗色模式下的导航栏调整 */
[data-theme="dark"] .navbar {
    background: rgba(28, 28, 30, 0.8);
    border-bottom: 1px solid var(--apple-gray-300);
}

/* 暗色模式下的主题切换按钮 */
[data-theme="dark"] .theme-toggle {
    border-color: var(--apple-gray-400);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--apple-hover-bg);
    border-color: var(--apple-gray-500);
}

/* 暗色模式下更新图标 */
[data-theme="dark"] .theme-icon::before {
    content: "☀️";
}

[data-theme="light"] .theme-icon::before {
    content: "🌙";
}

/* 移动端配色优化 */
@media (max-width: 768px) {
    /* 增强移动端触摸反馈 */
    .nav-link:active {
        background: var(--apple-active-bg);
        transform: scale(0.98);
    }
    
    .tab-btn:active {
        background: var(--apple-active-bg);
        transform: scale(0.95);
    }
    
    .metric-card:active {
        transform: translateY(-2px) scale(0.98);
    }
    
    .filter-apply-btn:active {
        transform: translateY(0) scale(0.95);
    }
    
    .filter-reset-btn:active {
        background: var(--apple-active-bg);
        transform: scale(0.95);
    }
    
    /* 移动端对比度增强 */
    .nav-link {
        color: var(--apple-gray-700);
        font-weight: 600;
    }
    
    .nav-link.active {
        color: var(--apple-blue);
        font-weight: 700;
    }
    
    /* 移动端按钮尺寸优化 */
    .theme-toggle {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .filter-apply-btn,
    .filter-reset-btn {
        min-height: 44px;
        font-weight: 600;
    }
    
    /* 移动端卡片间距优化 */
    .metric-card {
        margin-bottom: 20px;
        box-shadow: var(--apple-shadow-md);
    }
    
    /* 移动端表格优化 */
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    /* 移动端排行榜优化 */
    .rank-item {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .rank-item .rank {
        font-size: 20px;
    }
    
    .rank-item .name {
        font-size: 16px;
    }
    
    .rank-item .score {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    /* 小屏幕设备额外优化 */
    .nav-logo h2 {
        font-size: 18px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .metric-card h3 {
        font-size: 14px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    /* 小屏幕触摸目标优化 */
    .dashboard-tabs {
        padding: 6px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 12px;
        min-height: 40px;
    }
    
    /* 小屏幕对比度进一步增强 */
    .filter-group label {
        color: var(--apple-gray-600);
        font-weight: 700;
    }
    
    .metric-card h3 {
        color: var(--apple-gray-700);
        font-weight: 800;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .metric-card {
        border-width: 0.5px;
    }
    
    .navbar {
        border-bottom-width: 0.5px;
    }
    
    .dashboard-filters {
        border-width: 0.5px;
    }
    
    .filter-select,
    .filter-input {
        border-width: 0.5px;
    }
}

/* 触摸设备专用样式 */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停效果，使用激活状态 */
    .nav-link:hover {
        color: var(--apple-gray-600);
        background: transparent;
    }
    
    .nav-link:active {
        color: var(--apple-blue);
        background: var(--apple-blue-ultra-light);
    }
    
    .metric-card:hover {
        transform: none;
        box-shadow: var(--apple-shadow-sm);
    }
    
    .metric-card:active {
        transform: scale(0.98);
        box-shadow: var(--apple-shadow-md);
    }
    
    .tab-btn:hover {
        color: var(--apple-gray-500);
        background: transparent;
    }
    
    .tab-btn:active {
        color: var(--apple-blue);
        background: var(--apple-blue-ultra-light);
    }
    
    .rank-item:hover {
        background: var(--apple-white);
        transform: none;
    }
    
    .rank-item:active {
        background: var(--apple-blue-ultra-light);
        transform: translateX(2px);
    }
}
/* 暗色模式下
的特定样式调整 */
[data-theme="dark"] .metric-card {
    background: var(--apple-gray-100);
    border-color: var(--apple-gray-300);
}

[data-theme="dark"] .metric-card:hover {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
}

[data-theme="dark"] .dashboard-tabs {
    background: var(--apple-gray-100);
    border-color: var(--apple-gray-300);
}

[data-theme="dark"] .dashboard-filters {
    background: var(--apple-gray-100);
    border-color: var(--apple-gray-300);
}

[data-theme="dark"] .chart-container,
[data-theme="dark"] .rankings-container,
[data-theme="dark"] .data-table {
    background: var(--apple-gray-100);
    border-color: var(--apple-gray-300);
}

[data-theme="dark"] .rank-item {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
}

[data-theme="dark"] .rank-item:hover {
    background: var(--apple-gray-300);
    border-color: var(--apple-gray-500);
}

/* 暗色模式下的表格样式 */
[data-theme="dark"] th {
    background: var(--apple-gray-200);
    color: var(--apple-gray-800);
}

[data-theme="dark"] td {
    color: var(--apple-gray-700);
    border-bottom-color: var(--apple-gray-400);
}

[data-theme="dark"] tr:hover td {
    background: var(--apple-gray-300);
}

/* 暗色模式下的表单元素 */
[data-theme="dark"] .filter-select,
[data-theme="dark"] .filter-input {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
    color: var(--apple-gray-900);
}

[data-theme="dark"] .filter-select:focus,
[data-theme="dark"] .filter-input:focus {
    background: var(--apple-gray-100);
    border-color: var(--apple-blue);
}

/* 暗色模式下的按钮保持原有样式 */
[data-theme="dark"] .filter-apply-btn {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-blue-dark) 100%);
}

[data-theme="dark"] .filter-reset-btn {
    background: transparent;
    color: var(--apple-gray-600);
    border-color: var(--apple-gray-500);
}

[data-theme="dark"] .filter-reset-btn:hover {
    background: var(--apple-hover-bg);
    border-color: var(--apple-gray-600);
}/* 移
动端暗色模式特殊优化 */
@media (max-width: 768px) {
    [data-theme="dark"] .nav-link {
        color: var(--apple-gray-600);
        font-weight: 600;
    }
    
    [data-theme="dark"] .nav-link.active {
        color: var(--apple-blue);
        font-weight: 700;
        background: rgba(10, 132, 255, 0.2);
    }
    
    [data-theme="dark"] .metric-card {
        background: var(--apple-gray-200);
        border-color: var(--apple-gray-400);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    [data-theme="dark"] .metric-card h3 {
        color: var(--apple-gray-800);
        font-weight: 800;
    }
    
    [data-theme="dark"] .filter-group label {
        color: var(--apple-gray-700);
        font-weight: 700;
    }
    
    [data-theme="dark"] .dashboard-tabs {
        background: var(--apple-gray-200);
        border-color: var(--apple-gray-400);
    }
    
    [data-theme="dark"] .tab-btn {
        color: var(--apple-gray-700);
    }
    
    [data-theme="dark"] .tab-btn.active {
        color: var(--apple-blue);
        background: rgba(10, 132, 255, 0.2);
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .metric-card {
        border-width: 0.5px;
    }
    
    .nav-link {
        border-width: 0.5px;
    }
    
    .dashboard-tabs {
        border-width: 0.5px;
    }
    
    .filter-select,
    .filter-input {
        border-width: 0.5px;
    }
    
    /* 高DPI下的阴影优化 */
    .metric-card {
        box-shadow: 
            0 0.5px 1.5px rgba(0, 0, 0, 0.1),
            0 0.5px 1px rgba(0, 0, 0, 0.06);
    }
    
    .metric-card:hover {
        box-shadow: 
            0 5px 7.5px rgba(0, 0, 0, 0.1),
            0 2px 3px rgba(0, 0, 0, 0.05);
    }
}

/* 触摸设备特殊优化 */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备上增强按钮反馈 */
    .nav-link:active {
        background: var(--apple-blue-ultra-light);
        transform: scale(0.95);
    }
    
    .tab-btn:active {
        background: var(--apple-blue-ultra-light);
        transform: scale(0.95);
    }
    
    .filter-apply-btn:active {
        transform: scale(0.95);
        box-shadow: 0 1px 5px rgba(0, 122, 255, 0.3);
    }
    
    .metric-card:active {
        transform: scale(0.98);
        box-shadow: var(--apple-shadow-sm);
    }
    
    /* 触摸设备上的颜色对比度增强 */
    .nav-link {
        color: var(--apple-gray-800);
    }
    
    .tab-btn {
        color: var(--apple-gray-600);
    }
    
    .filter-group label {
        color: var(--apple-gray-600);
    }
}

/* 小屏幕设备的额外配色优化 */
@media (max-width: 480px) {
    /* 确保小屏幕上的可读性 */
    .section-title {
        color: var(--apple-gray-900);
        font-weight: 800;
    }
    
    .metric-card h3 {
        color: var(--apple-gray-700);
        font-weight: 800;
    }
    
    .metric-value {
        color: var(--apple-blue);
        font-weight: 900;
    }
    
    /* 小屏幕暗色模式优化 */
    [data-theme="dark"] .section-title {
        color: var(--apple-gray-100);
    }
    
    [data-theme="dark"] .metric-card h3 {
        color: var(--apple-gray-300);
    }
    
    [data-theme="dark"] .nav-logo h2 {
        color: var(--apple-gray-100);
    }
}/* 可访
问性和对比度优化 */

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        /* 高对比度模式下的颜色调整 */
        --apple-gray-500: #666666;
        --apple-gray-600: #555555;
        --apple-gray-700: #333333;
        --apple-blue: #0066cc;
        --apple-blue-dark: #004499;
        --apple-green: #228b22;
        --apple-red: #cc0000;
    }
    
    /* 增强边框对比度 */
    .metric-card,
    .dashboard-tabs,
    .dashboard-filters,
    .chart-container,
    .rankings-container,
    .data-table {
        border-width: 2px;
        border-color: var(--apple-gray-400);
    }
    
    /* 增强文字对比度 */
    .nav-link {
        color: var(--apple-gray-800);
        font-weight: 600;
    }
    
    .nav-link.active {
        color: var(--apple-blue);
        font-weight: 700;
        background: rgba(0, 102, 204, 0.15);
    }
    
    .tab-btn {
        color: var(--apple-gray-700);
        font-weight: 600;
    }
    
    .tab-btn.active {
        color: var(--apple-blue);
        font-weight: 700;
        background: rgba(0, 102, 204, 0.15);
    }
    
    /* 增强按钮对比度 */
    .filter-apply-btn {
        background: var(--apple-blue);
        border: 2px solid var(--apple-blue-dark);
    }
    
    .filter-reset-btn {
        border: 2px solid var(--apple-gray-600);
        color: var(--apple-gray-800);
    }
}

/* 色盲友好配色方案 */
.colorblind-friendly {
    /* 使用形状和图案辅助颜色区分 */
    --apple-green: #2e8b57; /* 更深的绿色 */
    --apple-red: #dc143c;   /* 更深的红色 */
    --apple-orange: #ff8c00; /* 保持橙色 */
    --apple-blue: #1e90ff;  /* 更亮的蓝色 */
}

/* 为色盲用户添加图案支持 */
.rank-item .score.positive::before {
    content: "↗ ";
    color: var(--apple-green);
}

.rank-item .score.negative::before {
    content: "↘ ";
    color: var(--apple-red);
}

.metric-value.increase::after {
    content: " ▲";
    font-size: 0.7em;
    color: var(--apple-green);
}

.metric-value.decrease::after {
    content: " ▼";
    font-size: 0.7em;
    color: var(--apple-red);
}

/* 键盘导航可见性优化 */
.nav-link:focus,
.tab-btn:focus,
.filter-apply-btn:focus,
.filter-reset-btn:focus,
.filter-select:focus,
.filter-input:focus,
.theme-toggle:focus {
    outline: 3px solid var(--apple-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--apple-white), 0 0 0 5px var(--apple-blue);
}

/* 暗色模式下的键盘导航 */
[data-theme="dark"] .nav-link:focus,
[data-theme="dark"] .tab-btn:focus,
[data-theme="dark"] .filter-apply-btn:focus,
[data-theme="dark"] .filter-reset-btn:focus,
[data-theme="dark"] .filter-select:focus,
[data-theme="dark"] .filter-input:focus,
[data-theme="dark"] .theme-toggle:focus {
    outline: 3px solid var(--apple-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--apple-black), 0 0 0 5px var(--apple-blue);
}

/* 跳过链接（屏幕阅读器支持） */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--apple-blue);
    color: var(--apple-white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--apple-radius-md);
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--apple-white);
    outline-offset: 2px;
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .metric-card:hover {
        transform: none;
    }
    
    .nav-link:hover,
    .tab-btn:hover,
    .filter-apply-btn:hover {
        transform: none;
    }
}

/* 强制颜色模式支持（Windows高对比度模式） */
@media (forced-colors: active) {
    .metric-card,
    .dashboard-tabs,
    .dashboard-filters,
    .chart-container,
    .rankings-container,
    .data-table {
        border: 1px solid ButtonText;
        background: ButtonFace;
    }
    
    .nav-link,
    .tab-btn {
        color: LinkText;
    }
    
    .nav-link.active,
    .tab-btn.active {
        background: Highlight;
        color: HighlightText;
    }
    
    .filter-apply-btn {
        background: ButtonFace;
        border: 1px solid ButtonText;
        color: ButtonText;
    }
    
    .filter-apply-btn:hover,
    .filter-apply-btn:focus {
        background: Highlight;
        color: HighlightText;
    }
}

/* ARIA状态指示器 */
[aria-pressed="true"] {
    background: var(--apple-blue-ultra-light);
    border-color: var(--apple-blue);
}

[aria-selected="true"] {
    background: var(--apple-blue-ultra-light);
    color: var(--apple-blue);
    font-weight: 600;
}

[aria-expanded="true"]::after {
    content: " ▲";
    font-size: 0.8em;
    color: var(--apple-blue);
}

[aria-expanded="false"]::after {
    content: " ▼";
    font-size: 0.8em;
    color: var(--apple-gray-500);
}

/* 错误状态和验证 */
.error {
    color: var(--apple-red);
    border-color: var(--apple-red);
}

.success {
    color: var(--apple-green);
    border-color: var(--apple-green);
}

.warning {
    color: var(--apple-orange);
    border-color: var(--apple-orange);
}

/* 加载状态可访问性 */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--apple-gray-300);
    border-top: 2px solid var(--apple-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点陷阱样式 */
.focus-trap {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

/* 对比度检查通过的颜色组合确认 */
.contrast-aa {
    /* 确保至少4.5:1的对比度 */
    background: var(--apple-white);
    color: var(--apple-gray-900);
}

.contrast-aaa {
    /* 确保至少7:1的对比度 */
    background: var(--apple-white);
    color: var(--apple-black);
}

[data-theme="dark"] .contrast-aa {
    background: var(--apple-black);
    color: var(--apple-gray-100);
}

[data-theme="dark"] .contrast-aaa {
    background: var(--apple-black);
    color: var(--apple-white);
}/* 
可访问性和对比度优化 */

/* 跳过链接样式 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--apple-blue);
    color: var(--apple-white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--apple-radius-md);
    font-weight: 600;
    z-index: 9999;
    transition: var(--apple-transition);
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--apple-focus-ring);
    outline-offset: 2px;
}

/* 焦点可见性增强 */
*:focus {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
    border-radius: var(--apple-radius-sm);
}

/* 移除默认焦点样式，使用自定义样式 */
*:focus:not(:focus-visible) {
    outline: none;
}

/* 键盘导航焦点样式 */
.nav-link:focus-visible {
    outline: 3px solid var(--apple-focus-ring);
    outline-offset: 2px;
    background: var(--apple-blue-ultra-light);
}

.tab-btn:focus-visible {
    outline: 3px solid var(--apple-focus-ring);
    outline-offset: 2px;
    background: var(--apple-blue-ultra-light);
}

.filter-apply-btn:focus-visible,
.filter-reset-btn:focus-visible {
    outline: 3px solid var(--apple-focus-ring);
    outline-offset: 2px;
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--apple-focus-ring);
    outline-offset: 2px;
    background: var(--apple-hover-bg);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --apple-gray-400: #808080;
        --apple-gray-500: #666666;
        --apple-gray-600: #4d4d4d;
        --apple-gray-700: #333333;
        --apple-gray-800: #1a1a1a;
        --apple-blue: #0066cc;
        --apple-blue-dark: #004499;
        --apple-green: #228b22;
        --apple-red: #cc0000;
    }
    
    .nav-link {
        border: 2px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        border-color: var(--apple-blue);
        background: var(--apple-white);
    }
    
    .nav-link.active {
        border-color: var(--apple-blue);
        background: var(--apple-white);
    }
    
    .metric-card {
        border: 2px solid var(--apple-gray-400);
    }
    
    .metric-card:hover,
    .metric-card:focus-within {
        border-color: var(--apple-blue);
    }
    
    .tab-btn {
        border: 2px solid var(--apple-gray-400);
    }
    
    .tab-btn:hover,
    .tab-btn:focus {
        border-color: var(--apple-blue);
    }
    
    .tab-btn.active {
        border-color: var(--apple-blue);
        background: var(--apple-white);
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .metric-card:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .filter-apply-btn:hover {
        transform: none;
    }
    
    .rank-item:hover {
        transform: none;
    }
}

/* 色盲友好优化 */
.metric-card::before {
    /* 为色盲用户添加图案区分 */
    background-image: repeating-linear-gradient(
        45deg,
        var(--apple-blue),
        var(--apple-blue) 2px,
        transparent 2px,
        transparent 4px
    );
}

.rank-item .score {
    /* 成功状态使用图标而不仅仅是颜色 */
    position: relative;
}

.rank-item .score::before {
    content: "✓ ";
    color: var(--apple-green);
    font-weight: bold;
}

/* 错误状态的可访问性 */
.message.error {
    border-left: 4px solid var(--apple-red);
}

.message.error::before {
    content: "⚠ ";
    font-weight: bold;
}

.message.success {
    border-left: 4px solid var(--apple-green);
}

.message.success::before {
    content: "✓ ";
    font-weight: bold;
}

/* 表格可访问性增强 */
table {
    border: 1px solid var(--apple-gray-300);
}

th {
    position: relative;
}

th::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--apple-blue);
}

/* 表格行的可访问性 */
tr:focus-within {
    outline: 2px solid var(--apple-blue);
    outline-offset: -2px;
}

/* 暗色模式下的可访问性优化 */
[data-theme="dark"] .skip-link {
    background: var(--apple-blue);
    color: var(--apple-white);
}

[data-theme="dark"] *:focus {
    outline-color: var(--apple-blue);
}

[data-theme="dark"] .nav-link:focus-visible {
    background: rgba(10, 132, 255, 0.2);
}

[data-theme="dark"] .tab-btn:focus-visible {
    background: rgba(10, 132, 255, 0.2);
}

/* 高对比度暗色模式 */
@media (prefers-contrast: high) and (prefers-color-scheme: dark) {
    [data-theme="dark"] {
        --apple-white: #000000;
        --apple-gray-50: #111111;
        --apple-gray-100: #222222;
        --apple-gray-200: #333333;
        --apple-gray-300: #555555;
        --apple-gray-400: #777777;
        --apple-gray-500: #999999;
        --apple-gray-600: #bbbbbb;
        --apple-gray-700: #dddddd;
        --apple-gray-800: #eeeeee;
        --apple-gray-900: #ffffff;
        --apple-blue: #66b3ff;
        --apple-green: #66ff66;
        --apple-red: #ff6666;
    }
}

/* 屏幕阅读器专用样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 为交互元素添加状态指示 */
.nav-link[aria-current="page"] {
    font-weight: 700;
    position: relative;
}

.nav-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--apple-blue);
    border-radius: 1px;
}

/* 加载状态的可访问性 */
.loading {
    position: relative;
}

.loading::after {
    content: "加载中...";
    position: absolute;
    left: -9999px;
    top: 0;
}

/* 确保所有交互元素都有足够的触摸目标 */
@media (max-width: 768px) {
    .nav-link,
    .tab-btn,
    .filter-apply-btn,
    .filter-reset-btn,
    .theme-toggle {
        min-height: 44px;
        min-width: 44px;
    }
}/* 趋势图
表样式 */
.trends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-container {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 25px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
    height: 400px;
    position: relative;
}

.chart-container:hover {
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-2px);
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--apple-gray-900);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--apple-gray-100);
    padding-bottom: 10px;
}

.chart-container canvas {
    width: 100% !important;
    height: calc(100% - 60px) !important;
}

/* 暗色模式下的图表样式 */
[data-theme="dark"] .chart-container {
    background: var(--apple-gray-100);
    border-color: var(--apple-gray-300);
}

[data-theme="dark"] .chart-title {
    color: var(--apple-gray-900);
    border-bottom-color: var(--apple-gray-300);
}

/* 响应式图表布局 */
@media (max-width: 1200px) {
    .trends-container {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .trends-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-container {
        height: 350px;
        padding: 20px;
    }
    
    .chart-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 300px;
        padding: 15px;
    }
    
    .chart-title {
        font-size: 14px;
        margin-bottom: 15px;
    }
}
/* 
筛选按钮样式补充 */
.filter-reset-btn {
    background: var(--apple-gray-100);
    color: var(--apple-gray-600);
    border: 1px solid var(--apple-gray-300);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 40px;
    min-width: 80px;
}

.filter-reset-btn:hover {
    background: var(--apple-gray-200);
    border-color: var(--apple-gray-400);
}

/* 无数据状态样式 */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--apple-gray-500);
    font-size: 16px;
    font-weight: 500;
    background: var(--apple-gray-50);
    border-radius: var(--apple-radius-md);
    border: 2px dashed var(--apple-gray-300);
}

/* 排行榜容器样式 */
.rankings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.ranking-section {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 25px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
}

.ranking-section:hover {
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-2px);
}

/* 排序控制样式 */
.ranking-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--apple-gray-300);
    background: var(--apple-white);
    color: var(--apple-gray-600);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.sort-btn.active {
    background: var(--apple-blue);
    color: var(--apple-white);
    border-color: var(--apple-blue);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.sort-btn:hover:not(.active) {
    border-color: var(--apple-blue);
    color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
}

/* 排行榜标题和图例 */
.ranking-header {
    margin-bottom: 20px;
}

.ranking-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--apple-gray-900);
    margin-bottom: 12px;
}

.ranking-legend {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--apple-blue-ultra-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-blue);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.legend-item {
    flex: 1;
    text-align: center;
}

.legend-item:first-child {
    flex: 0 0 60px;
    text-align: left;
}

.legend-item:last-child {
    flex: 0 0 100px;
    text-align: right;
}

/* 排行榜项目样式 */
.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--apple-white);
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    box-shadow: var(--apple-shadow-sm);
    border: 1px solid var(--apple-gray-200);
}

.rank-item:hover {
    background: var(--apple-blue-ultra-light);
    border-left-color: var(--apple-blue);
    transform: translateX(5px);
    box-shadow: var(--apple-shadow-md);
    border-color: rgba(0, 122, 255, 0.3);
}

.rank-item .rank {
    font-size: 20px;
    font-weight: 800;
    color: var(--apple-blue);
    min-width: 40px;
    text-align: center;
}

.rank-item .name {
    font-size: 16px;
    font-weight: 600;
    color: var(--apple-gray-900);
    flex: 1;
    margin-left: 20px;
}

.rank-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--apple-green);
    min-width: 80px;
    text-align: right;
}

/* 前三名特殊样式 */
.rank-item:nth-child(1) .rank {
    color: var(--apple-yellow);
}

.rank-item:nth-child(2) .rank {
    color: var(--apple-gray-500);
}

.rank-item:nth-child(3) .rank {
    color: var(--apple-orange);
}

/* 排行榜响应式优化 */
@media (max-width: 768px) {
    .ranking-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .ranking-tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ranking-controls {
        justify-content: center;
    }
    
    .rank-item {
        padding: 14px 16px;
    }
    
    .rank-item .rank {
        font-size: 18px;
        min-width: 35px;
    }
    
    .rank-item .name {
        font-size: 15px;
        margin-left: 15px;
    }
    
    .rank-item .value {
        font-size: 16px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .ranking-header h3 {
        font-size: 18px;
    }
    
    .ranking-legend {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .rank-item {
        padding: 12px 15px;
    }
    
    .rank-item .rank {
        font-size: 16px;
        min-width: 30px;
    }
    
    .rank-item .name {
        font-size: 14px;
        margin-left: 12px;
    }
    
    .rank-item .value {
        font-size: 15px;
        min-width: 60px;
    }
}/* 新的独
立排行榜样式 */
.rankings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.ranking-section {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 25px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
    transition: var(--apple-transition);
}

.ranking-section:hover {
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-2px);
}

.ranking-section .ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ranking-section .ranking-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--apple-gray-900);
    margin: 0;
}

.ranking-section .ranking-controls {
    display: flex;
    gap: 8px;
}

.ranking-section .ranking-legend {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--apple-blue-ultra-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-blue);
    border: 1px solid rgba(0, 122, 255, 0.2);
    margin-bottom: 15px;
}

.ranking-section .legend-item {
    flex: 1;
    text-align: center;
}

.ranking-section .legend-item:first-child {
    flex: 0 0 60px;
    text-align: left;
}

.ranking-section .legend-item:last-child {
    flex: 0 0 120px;
    text-align: right;
}

/* 响应式优化 - 独立排行榜 */
@media (max-width: 1200px) {
    .rankings-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .rankings-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ranking-section {
        padding: 20px;
    }
    
    .ranking-section .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ranking-section .ranking-header h3 {
        font-size: 16px;
    }
    
    .ranking-section .ranking-controls {
        align-self: flex-end;
    }
    
    .ranking-section .ranking-legend {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .ranking-section .legend-item:last-child {
        flex: 0 0 100px;
    }
}

@media (max-width: 480px) {
    .ranking-section {
        padding: 15px;
    }
    
    .ranking-section .ranking-header h3 {
        font-size: 15px;
    }
    
    .ranking-section .ranking-legend {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .ranking-section .legend-item:first-child {
        flex: 0 0 50px;
    }
    
    .ranking-section .legend-item:last-child {
        flex: 0 0 80px;
    }
}
/
* ==================== AI分析页面样式 ==================== */

.ai-analysis-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.ai-analysis-header {
    text-align: center;
    margin-bottom: 40px;
}

.ai-analysis-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--apple-gray-900);
    margin-bottom: 12px;
}

.ai-description {
    font-size: 18px;
    color: var(--apple-gray-600);
    margin: 0;
    line-height: 1.5;
}

/* 文件上传区域 */
.upload-section {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
}

.upload-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--apple-gray-900);
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed var(--apple-gray-300);
    border-radius: var(--apple-radius-lg);
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--apple-gray-50);
}

.upload-area:hover {
    border-color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
}

.upload-area.drag-over {
    border-color: var(--apple-blue);
    background: var(--apple-blue-ultra-light);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 48px;
    opacity: 0.7;
}

.upload-area p {
    margin: 0;
    font-size: 16px;
    color: var(--apple-gray-700);
}

.upload-hint {
    font-size: 14px !important;
    color: var(--apple-gray-500) !important;
}

.upload-btn {
    background: var(--apple-blue);
    color: var(--apple-white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--apple-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--apple-shadow-sm);
}

.upload-btn:hover {
    background: var(--apple-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md);
}

/* 上传进度条 */
.upload-progress {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--apple-gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apple-blue), var(--apple-blue-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--apple-gray-600);
    font-weight: 500;
}

/* 分析结果区域 */
.analysis-results {
    background: var(--apple-white);
    border-radius: var(--apple-radius-xl);
    padding: 30px;
    border: 1px solid var(--apple-gray-200);
    box-shadow: var(--apple-shadow-sm);
    min-height: 400px;
}

.analysis-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--apple-gray-900);
    margin-bottom: 20px;
}

.analysis-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--apple-gray-700);
}

.analysis-text h3 {
    color: var(--apple-blue);
    margin-top: 25px;
    margin-bottom: 15px;
}

.analysis-text ul {
    padding-left: 20px;
    margin: 15px 0;
}

.analysis-text li {
    margin-bottom: 8px;
    color: var(--apple-gray-700);
}

/* 文件分析结果样式 */
.file-analysis-result {
    animation: fadeInUp 0.5s ease;
}

.file-info {
    background: var(--apple-gray-50);
    border-radius: var(--apple-radius-lg);
    padding: 20px;
    margin-bottom: 25px;
}

.file-info h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--apple-gray-900);
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-weight: 500;
    color: var(--apple-gray-600);
}

.info-value {
    font-weight: 600;
    color: var(--apple-gray-900);
}

.analysis-summary,
.analysis-insights,
.analysis-recommendations {
    margin-bottom: 25px;
}

.analysis-summary h4,
.analysis-insights h4,
.analysis-recommendations h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--apple-gray-900);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-summary h4::before {
    content: "📊";
}

.analysis-insights h4::before {
    content: "💡";
}

.analysis-recommendations h4::before {
    content: "🚀";
}

.analysis-summary p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--apple-gray-700);
    background: var(--apple-blue-ultra-light);
    padding: 15px;
    border-radius: var(--apple-radius-md);
    border-left: 4px solid var(--apple-blue);
}

.analysis-insights ul,
.analysis-recommendations ul {
    list-style: none;
    padding: 0;
}

.analysis-insights li,
.analysis-recommendations li {
    background: var(--apple-white);
    border: 1px solid var(--apple-gray-200);
    border-radius: var(--apple-radius-md);
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 45px;
    transition: all 0.3s ease;
}

.analysis-insights li:hover,
.analysis-recommendations li:hover {
    background: var(--apple-gray-50);
    border-color: var(--apple-blue);
    transform: translateX(5px);
}

.analysis-insights li::before {
    content: "✓";
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--apple-green);
    font-weight: bold;
    font-size: 16px;
}

.analysis-recommendations li::before {
    content: "→";
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--apple-orange);
    font-weight: bold;
    font-size: 16px;
}

/* 操作按钮 */
.analysis-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--apple-gray-200);
}

.action-btn {
    padding: 12px 24px;
    border-radius: var(--apple-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--apple-shadow-sm);
}

.action-btn.primary {
    background: var(--apple-blue);
    color: var(--apple-white);
}

.action-btn.primary:hover {
    background: var(--apple-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md);
}

.action-btn.secondary {
    background: var(--apple-white);
    color: var(--apple-gray-700);
    border: 1px solid var(--apple-gray-300);
}

.action-btn.secondary:hover {
    background: var(--apple-gray-50);
    border-color: var(--apple-gray-400);
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md);
}

/* 错误信息样式 */
.error-message {
    text-align: center;
    padding: 40px 20px;
}

.error-message h3 {
    color: var(--apple-red);
    margin-bottom: 15px;
}

.error-message p {
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--apple-red);
    color: var(--apple-white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--apple-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--apple-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md);
}

/* 默认分析样式 */
.default-analysis {
    animation: fadeIn 0.5s ease;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-analysis-container {
        padding: 20px 15px;
    }
    
    .ai-analysis-header h2 {
        font-size: 28px;
    }
    
    .ai-description {
        font-size: 16px;
    }
    
    .upload-section,
    .analysis-results {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .analysis-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .ai-analysis-header h2 {
        font-size: 24px;
    }
    
    .upload-section h3,
    .analysis-content h3 {
        font-size: 20px;
    }
    
    .analysis-summary h4,
    .analysis-insights h4,
    .analysis-recommendations h4 {
        font-size: 18px;
    }
    
    .upload-area {
        padding: 25px 10px;
    }
    
    .upload-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}